
const routes = [
  { // [ALL] Title Page
    path: '/',
    name: 'title',
    component: () => import('pages/TitlePage.vue')
  },
  { // [ALL] Auth Page: Login
    path: '/auth',
    component: () => import('src/layouts/AuthLayout.vue'),
    name: 'auth',
    children: [
      { path: '', name: 'login', component: () => import('pages/auth/LoginPage.vue') }
    ]
  },
  { // [ALL] Change Password
    path: '/changePw',
    name: 'changePw',
    component: () => import('pages/auth/ChangePwPage.vue')
  },
  { // [ALL] Forgot Password
    path: '/forgotPw',
    name: 'forgotPw',
    component: () => import('pages/auth/ForgotPwPage.vue')
  },
  { // [ALL] Choose Role Page
    path: '/chooseRole',
    name: 'chooseRole',
    component: () => import('pages/ChooseRolePage.vue')
  },
  { // [ALL] Main Menu Page
    path: '/mainMenu',
    name: 'mainMenu',
    component: () => import('pages/MainMenuPage.vue')
  },

  // -------------------- MASS SCAN 批次扫描工单-----------------------
  { // [WORKER, QCLEADERS] Mass Scan (MS) 批次扫描工单(交收)
    path: '/massScan',
    name: 'massScan',
    component: () => import('src/layouts/mainMenu/MassScanLayout.vue')
    // props: { scanWOList: false }
  },
  { // [WORKER, QCLEADERS] Mass Scan - Work Order Record (MS - WOR) 工单工作纪录
    path: '/woRecord',
    name: 'woRecord',
    component: () => import('pages/massScan/WORecordPage.vue')
  },

  // -------------------- ENQUIRY REPORT 查询报表 -----------------------
  { // [ALL] Scan Work Order (ER) 查询报表
    path: '/enquiryReport',
    name: 'enquiryReport',
    component: () => import('src/layouts/mainMenu/EnquiryReportLayout.vue')
  },
  { // [WORKER] Stock Report (SR) 员工货存查询/存金报告
    path: '/stockReport',
    name: 'stockReport',
    component: () => import('src/pages/enquiryReport/worker/StockReportPage.vue')
  },
  { // [WORKER] Delivery Report (DR) 员工交收报表二(手工帐)
    path: '/deliveryReport',
    name: 'deliveryReport',
    component: () => import('src/pages/enquiryReport/worker/DeliveryReportPage.vue')
  },
  { // [WORKER] Delivery Enquiry (DE) 员工交收查询
    path: '/deliveryEnquiry',
    name: 'deliveryEnquiry',
    component: () => import('src/pages/enquiryReport/worker/DeliveryEnquiryPage.vue')
  },
  { // [WORKER] Worker Enquiry (DE) 员工签收查询
    path: '/workerEnquiry',
    name: 'workerEnquiry',
    component: () => import('src/pages/enquiryReport/worker/WorkerEnquiryPage.vue')
  },
  { // [QCLEADERS, DISPATCHER] Realtime Stock Report (RSR) 实时存货报表
    path: '/realtimeStockReport',
    name: 'realtimeStockReport',
    component: () => import('src/pages/enquiryReport/qc-dispatcher/RealtimeStockReportPage.vue')
  },
  { // [QCLEADERS, DISPATCHER] Product Transaction Inspection Report (PTIR) 检测货品交易报表
    path: '/productTransactInspectReport',
    name: 'productTransactInspectReport',
    component: () => import('src/pages/enquiryReport/qc-dispatcher/ProdTransInspectReportPage.vue')
  },
  { // [DISPATCHER] Leadtime Report (LR) 各工序节点Leadtime报表
    path: '/leadtimeReport',
    name: 'leadtimeReport',
    component: () => import('src/pages/enquiryReport/qc-dispatcher/LeadtimeReportPage.vue')
  },
  { // [DISPATCHER] Print Label Status Report (PLSR) 生产单标签打印状况报表
    path: '/printLabelStatusReport',
    name: 'printLabelStatusReport',
    component: () => import('src/pages/enquiryReport/qc-dispatcher/PrintLabelStatusReportPage.vue')
  },

  // -------------------- WORK ORDER DETAILS 工单查询 -----------------------
  { // [ALL] Work Order Details (WOD) 工单查询
    path: '/WODetails/:orderNo?/:tab?',
    name: 'WODetails',
    component: () => import('src/layouts/mainMenu/WODetailsLayout.vue'),
    props: route => ({ orderNo: route.params.orderNo, tab: route.params.tab })
    // props: route => ({ ...route.params })

  },

  // -------------------- PRINT WORK ORDER LABEL 打印标签 -----------------------
  { // [DISPATCHER] Print Work Order Label (PWOL) 打印标签
    path: '/printWOLabel',
    name: 'printWOLabel',
    component: () => import('src/layouts/mainMenu/PrintWOLabelLayout.vue')
  },

  // -------------------- UPLOAD WORK ORDER FLOW 上傳工單流程圖 -----------------------
  { // [DISPATCHER] Upload Work Order Flow (UWOF) 上傳工單流程圖
    path: '/uploadWOFlow',
    name: 'uploadWOFlow',
    component: () => import('src/layouts/mainMenu/UploadWOFlowLayout.vue')
  },
  { // [DISPATCHER] Edit Work Order Flow (EWOF) 编辑工單流程圖
    path: '/editWOFlow/:fgArticle_id',
    name: 'editWOFlow',
    component: () => import('src/pages/uploadWOflow/EditArticleTablePage.vue'),
    props: route => ({ fgArticle_id: route.params.fgArticle_id })
  },

  // When the page is not found -> show this page
  {
    path: '/:catchAll(.*)*',
    component: () => import('pages/ErrorNotFound.vue')
  }
]

export default routes
